package org.starapp.rbac.entity;

import javax.persistence.GenerationType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Column;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.google.common.collect.ImmutableList;
import java.util.Date;
import java.util.List;
import java.io.Serializable;
import javax.validation.constraints.DecimalMin;

/**
 * @author wangqiang@cisoft.com.cn
 *
 */
@Entity
@Table(name = "rbac_permissons")
public class Permissons implements Serializable{
		
				
		/**
		 * PERMISSON_ID
		 */
		private String permissonId;
				
		/**
		 * OWNER_ID
		 */
		private String ownerId;
				
		/**
		 * ALLOW
		 */
		private String allow;
				
		/**
		 * OWNER_TYPE
		 */
		private String ownerType;
		
		/**
		 * Operations
		 */
		private Operations operations;
		/**
		 * Objects
		 */
		private Objects objects;
		
		
				
		@Id
		@Column(name="PERMISSON_ID")
		@NotBlank		
		public String getPermissonId(){
			return this.permissonId;
		}
		
		public void setPermissonId(String permissonId){
			this.permissonId = permissonId;
		}
		
				
		public String getOwnerId(){
			return this.ownerId;
		}
		
		public void setOwnerId(String ownerId){
			this.ownerId = ownerId;
		}
		
				
		@NotBlank		
		public String getAllow(){
			return this.allow;
		}
		
		public void setAllow(String allow){
			this.allow = allow;
		}
		
				
		public String getOwnerType(){
			return this.ownerType;
		}
		
		public void setOwnerType(String ownerType){
			this.ownerType = ownerType;
		}
		
		
					
		@ManyToOne
		@JoinColumn(name = "OPERATION_ID")
		public Operations getOperations(){
			return this.operations;
		}
		
		public void setOperations(Operations operations){
			this.operations = operations;
		}
					
		@ManyToOne
		@JoinColumn(name = "OBJECT_ID")
		public Objects getObjects(){
			return this.objects;
		}
		
		public void setObjects(Objects objects){
			this.objects = objects;
		}

		
		@Override
		public String toString() {
			return ToStringBuilder.reflectionToString(this);
		}
	
	}

